package com.coding.controller;

import com.coding.dto.RestBean;
import com.coding.entity.UserFollowersVo;
import com.coding.service.UserFollowers0Service;
import com.coding.util.ResponseDTO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("userList")
public class UserFollowers0Controller {
    @Resource
    private UserFollowers0Service userFollowers0Service;
    //查询用户所关注的列表
    @RequestMapping("queryAllFollower")
    public RestBean<List<UserFollowersVo>> queryAllFollower(@RequestParam("id") String id) {
        System.out.println(id);
        return userFollowers0Service.queryAllFollower(id);
    }
    //取消关注
    @RequestMapping("updateStatus")
    public RestBean<Long> updateStatus(String id) {
        return userFollowers0Service.updateStatus(id);
    }

    //查询用户amd模糊查询
    @RequestMapping("blurName")
    public RestBean<List<UserFollowersVo>> blurName(String id,String userName) {
        System.out.println(userName);
        return userFollowers0Service.blurName(id,userName);
    }


    //查询互为朋友
    @RequestMapping("queryAllContacts")
    public RestBean<List<UserFollowersVo>> queryAllContacts(String id) {
        return userFollowers0Service.queryAllContacts(id);
    }
    //互为朋友查询and模糊查询
    @RequestMapping("contactsName")
    public RestBean<List<UserFollowersVo>> contactsName(String id,String userName) {
        return userFollowers0Service.ContactsName(id,userName);
    }
    //查询所有的粉丝
    @RequestMapping("queryAllFans")
    public RestBean<List<UserFollowersVo>> queryAllFans(String id) {
        return userFollowers0Service.queryAllFans(id);
    }


    // 粉丝查询and模糊查询
    @RequestMapping("fuzzyName")
    public RestBean<List<UserFollowersVo>> fuzzyName(String id, String userName) {

        return userFollowers0Service.fuzzyName(id,userName);
    }
    //回关
    @RequestMapping("insertFriend")
     public   RestBean<String>  insertFriend(@RequestParam("followeeId") String followeeId) {
        return userFollowers0Service.insertFriend(followeeId);
    }

}


